//
//  SEDoctorAuthCell.swift
//  SmartEyeForDoctor
//
//  Created by qdsg on 2021/5/6.
//

import UIKit

struct SEDoctorAuthCellModel{
    var title: String = ""
    var memo: String = ""
    var imageUrlStr: String = ""
    var placeholder: UIImage?
}

class SEDoctorAuthCell: UITableViewCell {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var memoLabel: UILabel!
    @IBOutlet weak var imgView: UIImageView! {
        didSet {
            imgView.layer.cornerRadius = 10
            imgView.layer.masksToBounds = true
        }
    }


    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    func updateData(_ model: SEDoctorAuthCellModel) {
        titleLabel.text = model.title
        memoLabel.text = model.memo
        if model.imageUrlStr.isEmpty {
            imgView.contentMode = .scaleAspectFit
            imgView.image = model.placeholder
        } else {
            imgView.contentMode = .scaleAspectFill
            imgView?.kf.setImage(urlString: model.imageUrlStr)
        }

    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
